// 路由-相关模块
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
// 创建路由规则
const routes = [
    {
        path: '/',
        redirect: '/layout'
    },
    {
        path: '/layout',
        redirect: '/layout/home',
        component: () => import("@/views/Layout/index.vue"),
        children: [
            {
                path: 'home',
                component: () => import("@/views/Home/index.vue"),
                meta: {
                    title: '首页'//meta表示元信息，可以在里面写一些自定义信息
                }
            },
            {
                path: 'search',
                component: () => import("@/views/Search/index.vue"),
                meta: {
                    title: '搜索'
                }
            }
        ]
    }
]
const router = new VueRouter({
    routes
})
export default router//导出路由